package com.example.diet_sport.controller;

import com.example.diet_sport.entity.inform;
import com.example.diet_sport.entity.sport;
import com.example.diet_sport.mapper.informMapper;
import com.example.diet_sport.mapper.sportMapper;
import com.example.diet_sport.mapper.usercalorieMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 伽蓝尘
 * @create 2023-06-08 13:15
 */
@RequestMapping("/inform")
@RestController
@CrossOrigin
public class informController {

    @Autowired
    private informMapper informMapper;

    @PostMapping("/add")
    @ResponseBody
    public int add(inform inform) {
        return informMapper.insert(inform);

    }

    @GetMapping("/informList")
    public List<inform> getSportList() {
        return informMapper.selectList(null);
    }


}
